//============================================================================
// Name        : SkipScannException.java
// Author      : iron.yin@gmail.com
// Version     : v1.0
// Copyright   : RisingSun CO,.LTD
// Description : SkipScannException.java in Java
//============================================================================
package cc.risingsun.wing.core.scanner;

/**
 * 
 * @author iron.yin@gmail.com
 * @sina 2012-8-1
 */
public class ScannerSkipException extends RuntimeException {

	private static final long serialVersionUID = -3497916150856418949L;

	private String resource;
	private SkipCode code;

	public ScannerSkipException(SkipCode code, String resource,String name) {
		super(String.format(code.getTemplate(), name,resource));
		this.resource = resource;
		this.code = code;
	}

	public String getResource() {
		return resource;
	}

	public SkipCode getSkipConde() {
		return code;
	}

	public enum SkipCode {
		NONPUBLIC("%s is not public,from %s SKIPED!"), NONCONTAIN("%s is not contains, from %s SKIPED!"),NONINTERFACE("%s is not interface type , %s is support interface type only. SKIPED");
		private String contentTemplate;

		SkipCode(String content) {
			contentTemplate = content;
		}
		
		public String getTemplate(){
			return contentTemplate;
		}
	}

}
